/**
 * Copyright (c) 2011 Nokia Corporation.
 */

#ifndef FILEMANAGER_H
#define FILEMANAGER_H

// Qt includes
#include <QDir>
#include <QList>
#include <QObject>
#include <QString>

// QtMobility includes
#include <qsysteminfo.h>

// Forward declarations
class DriveModel;
class FileModel;


class FileManager : public QObject
{
    Q_OBJECT

public: // Construction and destruction.
    explicit FileManager(QObject *parent = 0);
    explicit FileManager(DriveModel *driveModel, QObject *parent = 0);
    virtual ~FileManager();

public:
    void setDriveModel(DriveModel *model);
    void populateModel(FileModel &model, QDir dir) const;
    void getFolderContent(QDir dir,
                          QList<QFileInfo> &files,
                          bool recursive = true) const;
    qlonglong freeSpaceOnDrive(const QString &driveVolume) const;

private:
    void initialize();

private slots:
    void updateDrives(bool added = false, const QString &vol = QString());

private:
    QtMobility::QSystemStorageInfo *m_sysStorageInfo; // Owned
    DriveModel *m_driveModel; // Not owned
};


#endif // FILEMANAGER_H

// End of file.
